#ifndef __HTTP_PROT_STATUS_H_
#define __HTTP_PROT_STATUS_H_


namespace httpprot
{
	// =====
	// Do not forget to add to GetStatusCodeString, GetStatusReasonString
	// =====
	enum Status
	{
		STATUS_100_CONTINUE = 100,
		STATUS_101_SWITCHING_PROTOCOLS,
		STATUS_200_OK = 200,
		STATUS_201_CREATED,
		STATUS_202_ACCEPTED,
		STATUS_203_NON_AUTH_INFO,
		STATUS_204_NO_CONTENT,
		STATUS_205_RESET_CONTENT,
		STATUS_206_PARTIAL_CONTENT,
		STATUS_300_MULTIPLE_CHOICES = 300,
		STATUS_301_MOVED_PERMANENTLY,
		STATUS_302_FOUND,
		STATUS_303_SEE_OTHER,
		STATUS_304_NOT_MODIFIED,
		STATUS_305_USE_PROXY,
		STATUS_307_TEMPORARY_REDIRECT,
		STATUS_400_BAD_REQUEST = 400,
		STATUS_401_UNAUTHORIZED,
		STATUS_402_PAYMENT_REQUIRED,
		STATUS_403_FORBIDDEN,
		STATUS_404_NOT_FOUND,
		STATUS_405_METHOD_NOT_ALLOWED,
		STATUS_406_NOT_ACCEPTABLE,
		STATUS_407_PROXY_AUTHENTICATION_REQUIRED,
		STATUS_408_REQUEST_TIME_OUT,
		STATUS_409_CONFLICT,
		STATUS_410_GONE,
		STATUS_411_LENGTH_REQUIRED,
		STATUS_412_PRECONDITION_FAILED,
		STATUS_413_REQUEST_ENTITY_TOO_LARGE,
		STATUS_414_REQUEST_URI_TOO_LARGE,
		STATUS_415_UNSUPPORTED_MEDIA_TYPE,
		STATUS_416_REQUESTED_RANGE_NOT_SATISFIABLE,
		STATUS_417_EXPECTATION_FAILED,
		STATUS_500_INTERNAL_SERVER_ERROR = 500,
		STATUS_501_NOT_IMPLEMENTED,
		STATUS_502_BAD_GATEWAY,
		STATUS_503_SERVICE_UNAVAILABLE,
		STATUS_504_GATEWAY_TIME_OUT,
		STATUS_505_HTTP_VERSION_NOT_SUPPORTED
	};

	inline
	const char * GetStatusCodeString( Status status )
	{
		const char * statusToStatusString[ ] =
		{
			"100", // STATUS_100_CONTINUE
			"101", // STATUS_101_SWITCHING_PROTOCOLS
			"200", // STATUS_200_OK
			"201", // STATUS_201_CREATED
			"202", // STATUS_202_ACCEPTED
			"203", // STATUS_203_NON_AUTH_INFO
			"204", // STATUS_204_NO_CONTENT
			"205", // STATUS_205_RESET_CONTENT
			"206", // STATUS_206_PARTIAL_CONTENT
			"300", // STATUS_300_MULTIPLE_CHOICES
			"301", // STATUS_301_MOVED_PERMANENTLY
			"302", // STATUS_302_FOUND
			"303", // STATUS_303_SEE_OTHER
			"304", // STATUS_304_NOT_MODIFIED
			"305", // STATUS_305_USE_PROXY
			"307", // STATUS_307_TEMPORARY_REDIRECT
			"400", // STATUS_400_BAD_REQUEST
			"401", // STATUS_401_UNAUTHORIZED
			"402", // STATUS_402_PAYMENT_REQUIRED
			"403", // STATUS_403_FORBIDDEN
			"404", // STATUS_404_NOT_FOUND
			"405", // STATUS_405_METHOD_NOT_ALLOWED
			"406", // STATUS_406_NOT_ACCEPTABLE
			"407", // STATUS_407_PROXY_AUTHENTICATION_REQUIRED
			"408", // STATUS_408_REQUEST_TIME_OUT
			"409", // STATUS_409_CONFLICT
			"410", // STATUS_410_GONE
			"411", // STATUS_411_LENGTH_REQUIRED
			"412", // STATUS_412_PRECONDITION_FAILED
			"413", // STATUS_413_REQUEST_ENTITY_TOO_LARGE
			"414", // STATUS_414_REQUEST_URI_TOO_LARGE
			"415", // STATUS_415_UNSUPPORTED_MEDIA_TYPE
			"416", // STATUS_416_REQUESTED_RANGE_NOT_SATISFIABLE
			"417", // STATUS_417_EXPECTATION_FAILED
			"500", // STATUS_500_INTERNAL_SERVER_ERROR
			"501", // STATUS_501_NOT_IMPLEMENTED
			"502", // STATUS_502_BAD_GATEWAY
			"503", // STATUS_503_SERVICE_UNAVAILABLE
			"504", // STATUS_504_GATEWAY_TIME_OUT
			"505" // STATUS_505_HTTP_VERSION_NOT_SUPPORTED
		};

		return statusToStatusString[ status ];
	}

	inline
	const char * GetStatusReasonString( Status status )
	{
		const char * statusToReasonString[ ] =
		{
			"continue",
			"switching protocols",
			"ok",
			"created",
			"accepted",
			"non-auth info",
			"no content",
			"reset content",
			"partial content",
			"multiple choices",
			"moved permanently",
			"found",
			"see other",
			"not modified",
			"use proxy",
			"temporary redirect",
			"bad request",
			"unauthorized",
			"payment required",
			"forbidden",
			"not found",
			"method not allowed",
			"not acceptable",
			"proxy authentication required",
			"request time out",
			"conflict",
			"gone",
			"length required",
			"precondition failed",
			"request entity too large",
			"request uri too large",
			"unsupported media type",
			"requested range not satisfiable",
			"expectation failed",
			"internal server error",
			"not implemented",
			"bad gateway",
			"service unavailable",
			"gateway time out",
			"http version not supported"
		};

		return statusToReasonString[ status ];
	}
};

#endif